package com.game.autoTool.project.web.controller;

import com.game.autoTool.project.web.domain.entity.GameFunctionOperateFlow;
import com.game.autoTool.project.web.domain.req.CommonScreenshotReq;
import com.game.autoTool.project.web.domain.req.GetFunctionFlowReq;
import com.game.autoTool.project.web.domain.resp.GameFunctionOperateFlowResp;
import com.game.autoTool.project.web.domain.resp.Result;
import com.game.autoTool.project.web.domain.resp.ScreenshotOcrResp;
import com.game.autoTool.project.web.service.GameFunctionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/game")
public class GameFunctionController {

    @Autowired
    private GameFunctionService gameFunctionService;

    /**
     * 获取功能流程记录
     *
     * @return
     */
    @PostMapping(value = "/function/flow")
    public Result<List<GameFunctionOperateFlowResp>> getFunctionFlow(@RequestBody GetFunctionFlowReq req) {
        return Result.succeed(gameFunctionService.getFunctionFlow(req));
    }


    /**
     * 获取所有活动的公共截图列表
     *
     * @return
     */
    @PostMapping(value = "/common/screenshot")
    public Result<List<ScreenshotOcrResp>> getCommonScreenshot(@RequestBody CommonScreenshotReq req) {
        return Result.succeed(gameFunctionService.getCommonScreenshot(req));
    }
}
